package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.devicecontroller.command;

import net.wimpi.modbus.msg.ModbusRequest;
import net.wimpi.modbus.msg.ModbusResponse;

public interface Command {

	public static final int WAITING = 0;
	public static final int PROCESSING = 1;
	public static final int DONE = 2;
	public static final int FAIL = 3;
	public static final int NOT_EXECUTING = 4;
	
	public boolean needRetrieve();

	public ModbusRequest getRetriveRequest() throws CommandException;

	public void setRetrieveResponse(ModbusResponse res) throws CommandException;

	public ModbusRequest getCommandRequest();

	public void setState(int newstate);
	
	public int getState();
	
	public void addCommandListener(CommandListener cmdlistener);
	
	public void removeCommandListener(CommandListener cmdlistener);
	
}
